Package util

Class DukeApplicationTest

java.lang.Object
org.testfx.api.FxRobot
org.testfx.framework.junit5.ApplicationTest
util.DukeApplicationTest
All Implemented Interfaces:
org.testfx.api.FxRobotInterface, org.testfx.framework.junit5.ApplicationFixture
Direct Known Subclasses:
ViewTest

public class DukeApplicationTest extends org.testfx.framework.junit5.ApplicationTest
This class acts as an intermediary between an OpenJFX application and TestFX. It adds support for some extra UI components and employs a hack to work around an existing bug in the current version to get them all to work properly.
Author:
Robert C. Duvall
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Simulate a click on any kind of button
    protected void
    clickOn(GridPane g, Node item)
    Simulate a click within given GridPane
    protected void
    clickOn(Node n, int x, int y)
    Simulate a click within a non-button node
    protected String
    Returns message displayed in currently displayed DialogBox
    protected void
    Run given view method as a JFX action, allowing you to add/remove components from the Scene or Stage.
    protected void
    Simulate selecting given value from a ChoiceBox
    protected void
    Simulate selecting given value from a ComboBox
    protected void
    Simulate selecting given value from a ListView
    static void
     
    protected void
    Simulate setting a ColorPicker to given value
    protected void
    setValue(Slider s, double value)
    Simulate setting a Slider to given value
    protected void
    simulateAction(double x, double y, Runnable action)
     
    protected void
     
    void
     
    protected void
    Simulate writing given text(s) within the fields of a DialogBox
    protected void
    Simulate typing given text in any text component

    Methods inherited from class org.testfx.framework.junit5.ApplicationTest

    getHostServices, getParameters, init, internalAfter, internalBefore, launch, notifyPreloader, start, stop

    Methods inherited from class org.testfx.api.FxRobot

    bounds, bounds, bounds, bounds, bounds, bounds, bounds, bounds, bounds, capture, capture, capture, capture, capture, capture, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, closeCurrentWindow, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, drag, drag, drag, drag, drag, drag, drag, drag, drag, drag, drag, drop, dropBy, dropTo, dropTo, dropTo, dropTo, dropTo, dropTo, dropTo, dropTo, dropTo, dropTo, eraseText, from, from, from, fromAll, interact, interact, interactNoWait, interactNoWait, interrupt, interrupt, listTargetWindows, listWindows, lookup, lookup, lookup, moveBy, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, offset, offset, offset, offset, offset, offset, offset, offset, offset, point, point, point, point, point, point, point, point, point, press, press, push, push, release, release, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, robotContext, rootNode, rootNode, rootNode, scroll, scroll, scroll, scroll, scroll, sleep, sleep, targetPos, targetWindow, targetWindow, targetWindow, targetWindow, targetWindow, targetWindow, targetWindow, targetWindow, type, type, window, window, window, window, window, window, write, write, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.testfx.api.FxRobotInterface

    clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, clickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, doubleClickOn, moveBy, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, moveTo, offset, offset, offset, offset, offset, offset, offset, offset, offset, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn, rightClickOn
  • Constructor Details

    • DukeApplicationTest

      public DukeApplicationTest()
  • Method Details

    • setUpClass

      @BeforeAll public static void setUpClass()
    • tearDown

      @AfterEach public void tearDown() throws Exception
      Throws:
      Exception
    • clickOn

      protected void clickOn(ButtonBase b)
      Simulate a click on any kind of button
    • clickOn

      protected void clickOn(GridPane g, Node item)
      Simulate a click within given GridPane
    • clickOn

      protected void clickOn(Node n, int x, int y)
      Simulate a click within a non-button node
    • writeInputTo

      protected void writeInputTo(TextInputControl t, String text)
      Simulate typing given text in any text component
    • writeInputsToDialog

      protected void writeInputsToDialog(String... textInput)
      Simulate writing given text(s) within the fields of a DialogBox
    • setValue

      protected void setValue(Slider s, double value)
      Simulate setting a Slider to given value
    • setValue

      protected void setValue(ColorPicker cp, Color value)
      Simulate setting a ColorPicker to given value
    • select

      protected void select(ComboBox<String> cb, String value)
      Simulate selecting given value from a ComboBox
    • select

      protected void select(ChoiceBox<String> cb, String value)
      Simulate selecting given value from a ChoiceBox
    • select

      protected void select(ListView<String> lv, String value)
      Simulate selecting given value from a ListView
    • getDialogMessage

      protected String getDialogMessage()
      Returns message displayed in currently displayed DialogBox
    • runAsJFXAction

      protected void runAsJFXAction(Runnable action)
      Run given view method as a JFX action, allowing you to add/remove components from the Scene or Stage.
    • simulateAction

      protected void simulateAction(Node n, Runnable action)
    • simulateAction

      protected void simulateAction(double x, double y, Runnable action)